/*
 * @Author: YNT 2501512800@qq.com
 * @Date: 2022-05-23 00:01:58
 * @LastEditors: YNT 2501512800@qq.com
 * @LastEditTime: 2022-10-19 13:15:16
 * @FilePath: \22-03-19 智慧社区\api\volunteer.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  //  获取当前志愿者状态
  volunteerStatus() {
    return this.request({
      url: `/api/v1/party_volunteer/check`,
      method: 'GET',
    })
  }

  //  志愿者申请
  volunteerApply() {
    return this.request({
      url: `/api/v1/party_volunteer/join`,
      method: 'GET',
    })
  }

  // 志愿者组织
  volunteerList() {
    return this.request({
      url: `/api/volunteer/group`,
      method: 'GET',
    })
  }

  // // 申请加入志愿者组织
  volunteerPartJoin(params) {
    return this.request({
      url: `/api/volunteer/group`,
      method: 'POST',
      params,
    })
  }

  // 志愿者活动列表
  volunteerActList() {
    return this.request({
      url: `/api/v1/party_volunteer/activity/list`,
      method: 'GET',
    })
  }

  // 志愿者活动详情
  volunteerActDetail(id) {
    return this.request({
      url: `/api/v1/party_volunteer/activity?id=${id}`,
      method: 'GET',
    })
  }

  // 志愿评论
  volunteerComment(params) {
    return this.request({
      url: `/api/v1/party_volunteer/activity/comment`,
      method: 'POST',
      params,
    })
  }

  // 志愿评论点赞
  volunteerCommentLike(params) {
    return this.request({
      url: `/api/v1/party_volunteer/activity/comment/like`,
      method: 'get',
      params,
    })
  }

  // 志愿活动报名
  volunteerSign(id) {
    return this.request({
      url: `/api/v1/party_volunteer/activity/get_sign_up?id=${id}`,
      method: 'GET',
    })
  }

  // 志愿活动签到
  volunteerSignIn(id) {
    return this.request({
      url: `/api/v1/party_volunteer/activity/get_sign_in?id=${id}`,
      method: 'GET',
    })
  }

  // qr_code换activity_id
  getActivityId(data) {
    return this.request({
      url: `/api/v1/party_volunteer/activity/qr_code_id`,
      method: 'POST',
      data,
    })
  }
}

export default new SpecialModel()
